
// eslint-disable-next-line no-shadow
export function search({ pg, search } = {}) {
  return RSocket.rs({
    route: 'cbv.app',
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function count({ search }) {
  return RSocket.rr({
    route: 'cbv.app.count',
    args: {
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function dictSearch({ pg, search } = {}) {
  return RSocket.rs({
    route: 'dicts.travelPagePath.items',
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function dictCount({ search }) {
  return RSocket.rr({
    route: 'dicts.travelPagePath.items.count',
    args: {
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function entryLogo({ pg, search } = {}) {
  return RSocket.rs({
    route: 'dicts.entryLogo.items',
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function entryLogoCount({ search }) {
  return RSocket.rr({
    route: 'dicts.entryLogo.items.count',
    args: {
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function globalNotice({ pg, search } = {}) {
  return RSocket.rs({
    route: 'dicts.globalNotice.items',
    args: {
      pg: { ...pg },
      search: {
        ...search,
      },
    },
  });
}

// eslint-disable-next-line no-shadow
export function globalNoticeCount({ search }) {
  return RSocket.rr({
    route: 'dicts.globalNotice.items.count',
    args: {
      search: {
        ...search,
      },
    },
  });
}

export function get(id) {
  return RSocket.rr({
    route: `cbv.app.${id}`,
  });
}

export function xcxDelete(id) {
  return RSocket.rr({
    route: `cbv.app.${id}.delete`,
  });
}

export function create(data) {
  return RSocket.rr({
    route: 'cbv.app.create',
    data: {
      ...data,
    },
  });
}

export function update(data) {
  return RSocket.rr({
    route: 'cbv.app.update',
    data: {
      ...data,
    },
  });
}

// 获取字典项
export function getDict(dictId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items`,
    args: {
      pg: { size: 99, page: 0 },
    },
  });
}

// 获取字典项
export function getDictCount(dictId) {
  return RSocket.rr({
    route: `dicts.${dictId}.items.count`,
  });
}

// 获取城市
export function getCity(dictId) {
  return RSocket.rs({
    route: `dicts.${dictId}.items.top`,
  });
}

// 创建字典项
export function addItemId(dictId, data) {
  return RSocket.rr({
    route: `dicts.${dictId}.items.create`,
    data: {
      ...data,
    },
  });
}
// 删除字典项
export function removeItemId(dictId, itemId) {
  return RSocket.rr({
    route: `dicts.${dictId}.items.${itemId}.delete`,
  });
}

// 修改字典项
export function dictUpdate(dictId, data) {
  return RSocket.rr({
    route: `dicts.${dictId}.items.replace`,
    data: {
      ...data,
    },
  });
}

/**
 * 专线获取站点
 */
export function getScStation(data) {
  return RSocket.rs({
    route: 'prices.get.sc.station',
    data: {
      ...data,
    },
  });
}

/**
 * 专线获取城市
 */
export function getScCity(data) {
  return RSocket.rs({
    route: 'prices.get.sc.city',
    args: {
      ...data,
    },
  });
}

/**
 * 拼车获取站点
 */
export function getRsStation(data) {
  return RSocket.rs({
    route: 'prices.get.rs.station',
    data: {
      ...data,
    },
  });
}

/**
 * 拼车获取城市
 */
export function getRsCity(data) {
  return RSocket.rs({
    route: 'prices.get.rs.city',
    args: {
      ...data,
    },
  });
}

/**
 * 包车获取城市
 */
export function getCcCity(args) {
  return RSocket.rs({
    route: 'prices.get.cc.city',
    args: {
      ...args,
    },
  });
}

/**
 * 包车获取站点
 */
export function getCcStation(data) {
  return RSocket.rs({
    route: 'prices.get.cc.station',
    args: {
      ...data,
    },
  });
}

/**
 * 巴士获取城市
 */
export function getBusCity(args) {
  return RSocket.rs({
    route: 'prices.get.bus.city',
    args: {
      ...args,
    },
  });
}

/**
 * 巴士获取站点
 */
export function getBusStation(data) {
  return RSocket.rs({
    route: 'prices.get.bus.station',
    data: {
      ...data,
    },
  });
}
